@page "/KubectExplainView"
@using Extension
@inherits DrawerPageBase<string>


<Divider>@Field</Divider>
<Card Title=@L["k8s output"]>
    <p>
        @((MarkupString)_result.ToHtmlDisplay())
    </p>
</Card>


@if (!string.IsNullOrEmpty(_translateResult))
{
    <Card Title="@((AiService.Enabled() ? AiService.Name() : "") + @L["Translation"])">
        @if (AiService.Enabled())
        {
            <p>
                <Button Icon="@IconType.Fill.Frown" Type="@ButtonType.Link" OnClick="@ReTranslate">@L["Not satisfied with this translation, retranslate."]</Button>
            </p>
        }
        <p>
            @((MarkupString)_translateResult.ToHtmlDisplay())
        </p>
    </Card>
}
@if (string.IsNullOrEmpty(_translateResult) && AiService.Enabled())
{
    <Card Title="@((AiService.Enabled() ? AiService.Name() : "") + L["Translation"])">
        <Spin/>
    </Card>
}
